<?xml version="1.0" encoding="utf-8"?>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ page contentType="text/html; charset=UTF-8"%> 
 	
	<%@include file="loading.jsp" %>	
  	<script type="text/javascript">
		     function okButton(){
     
       $('#exlcuir').click();
       
     };
    
		
</script>
	<sj:dialog id="mybuttondialog" name="dialogexcluiravisomural" buttons="{'OK':function() {okButton();$(this).dialog('close');},'Cancel':function() { $(this).dialog('close'); } }" autoOpen="false" modal="true" title="Excluir Registro" effect="explode" hideEffect="explode">   
     Excluir Agrupamento? Lembre-se de que os Estandes tambem serao apagados.
    </sj:dialog>
    
   <div id="divsumir" name="divsumir"> 
  <s:form action="mantercentro!saveCentro" theme="simple"  method="post" id="form">
  	 <s:url id="urlexcluircentro" action="mantercentro!deleteCentro">
			<s:param name="idCentro"><s:property value="centro.id"/>
			</s:param>
			</s:url>
			<sj:a onclick="divSumir();" href="%{urlexcluircentro}"   targets="main" id="exlcuir"></sj:a>
  

  	 <div id="nav">
      <!-- skiplink anchor: navigation -->
      <a id="navigation" name="navigation"></a>

      <div class="hlist">
        <ul>
        <li>
         	<sj:a onclick="divSumir();" id="retornar" href="listarcentros"  targets="main">Retornar
    		</sj:a> 
    	</li>	 
          <li>
          	<sj:a id="ajaxformlink" formIds="form"  targets="main" onclick="divSumir();" >Salvar
    		</sj:a>
          	
	      </li>
	      <s:if test="%{idCentro != null}">
	      	<li>
          		<sj:a openDialog="mybuttondialog">Excluir</sj:a>	
          	</li>
          	
          	<s:url action="listarestandes" id="urllistarestandes">
				<s:param name="idCentro">
					<s:property value="idCentro"/>
				</s:param>
			</s:url>			
          	</s:if>
          
          
        </ul>
      </div>
    </div>	
  	<s:actionerror cssClass="ui-state-error ui-corner-all" cssStyle="padding: 0pt 0.7em;"/>  	 
  	<s:actionmessage cssClass="ui-state-highlight ui-corner-all" cssStyle="padding: 0pt 0.7em; margin-top: 20px;"/>
		
	 <fieldset class="ui-widget ui-widget-content ui-corner-all" style="margin: 10px">
  	 		<legend class="ui-state-default ui-corner-all">&nbsp;&nbsp;&nbsp;Agrupamento&nbsp;&nbsp;&nbsp;</legend>
  	 		<br>
		<table width="100%">
		<tr valign="top" style="height: 40px;">	
			<td>
    			<s:label value="Nome:"/>    		
    			
					<s:textfield name="centro.nome" />
					
					
				<s:if test="%{centro.id != null}">	
				
					<s:hidden name="idCentro"/>
					<s:hidden name="centro.id"/>
					<s:hidden name="centro.dtCriacao"/>
				</s:if>
			</td>		
			
			</table>
	
	</fieldset>
	
 </s:form>
 
 <s:if test="%{idCentro != null}">
 	<img id="indicator2" src="images/indicator2.gif" alt="Loading..." style="display:none"/>
 	 <sj:div href="%{urllistarestandes}" id="listaestandes" indicator="indicator2">
        
    </sj:div>

</s:if>
</div>
 	

